import matplotlib.pyplot as plt

# 四个数组数据
import numpy as np

from complex_PLM.PRNG import PRNG_Cplx_T, PRNG_Cplx


def showZChart(y1,y2,y3,y4):
    plt.figure()
    plt.rcParams['font.sans-serif'] = ['SimSun']  # 设置中文字体为宋体
    plt.rcParams['font.serif'] = ['Times New Roman']  # 设置西文字体为Times New Roman

    # 解决负号'-'显示为方块的问题
    plt.rcParams['axes.unicode_minus'] = False
    plt.rcParams['font.size'] = 24
    x = range(1, 17)  # 横坐标序号
    # X1的分布
    plt.plot(x, y1, label="Initial key", color="#FF3B1D", marker='*', linestyle="-")
    # X2的分布
    plt.plot(x, y2, label="Case 1", color="#3399FF", marker='o', linestyle="-")
    # X3的分布
    plt.plot(x, y3, label="Case 2", color="#F9A602", marker='s', linestyle="-")
    # X4的分布
    plt.plot(x, y4, label="Case 3", color ="#13C4A3", marker='d', linestyle="-")
    plt.legend()
    # plt.xlim(0, 255)  # 设置横坐标范围
    plt.ylim(0, 255)  # 设置纵坐标范围
    # plt.xticks([0, 50, 100, 150, 200, 250])  # 设置横坐标刻度值
    plt.yticks([0, 50, 100, 150, 200, 250])  # 设置纵坐标刻度值
    # plt.title("Lake.bmp")
    plt.xlabel("n")
    plt.ylabel("x_n")
    plt.show()


if __name__ == '__main__':
    len = 1000
    y1 = PRNG_Cplx(0.23,1000,len,True,4)
    y2 = PRNG_Cplx(0.23000000000001, 64, len, True, 4)
    y3 = PRNG_Cplx(0.23, 65, len, True, 4)
    y4 = PRNG_Cplx(0.23, 64, len, True, 3.99000000000001)
    print(y1)
    print(y2)
    print(y3)
    print(y4)


    # showZChart(y1,y2,y3,y4)
    # correlation1 = np.corrcoef(y1, y2)[0, 1]
    # correlation2 = np.corrcoef(y1, y3)[0, 1]
    # correlation3 = np.corrcoef(y1, y4)[0, 1]
    #
    # print(y1)
    # print(correlation2)
    # print(correlation3)
